(function(){if(typeof window.locator=="object"){return;}var n,w,L,k,d,A={},F="LocatorMessages";gloader.load(["glow","1","glow.dom","glow.events","glow.net","glow.i18n"],{onLoad:function(P){n=P;w=n.events;L=n.net;k=n.lang;d=n.i18n;n.ready(function(){A.cookie=v();});d.addLocaleModule(F,"en",{help:{title:"My Location Help",body:"The My Location feature takes a location of your choice and uses it to display relevant information on the BBC News and Weather websites. You only need to set it in one place and the information is automatically shared."}});}});var y="MYLOC",h=".bbc.co.uk",u="365",O=4,e="@",q="|",g="~";var b=false;var K=4;var p=true,M="cachebuster=cb{random}",t="locator";var N={A:"WCW",B:"WID",C:"LOCATOR"};var J="http://news.bbc.co.uk",H="/weather/util/search/WeatherSuggestJSON",m="/weather/util/search/WeatherSearch",o="/weather/forecast/{loc}/Location";var B=J+H+".{format}?region={region}&search={search}&jsoncallback={callback}",s=J+m+".{format}?region={region}&search={search}&jsoncallback={callback}",f=J+m+".{format}?region={region}&lat={lat}&lon={lon}&radius={radius}&jsoncallback={callback}",D=J+o+".{format}?jsoncallback={callback}",c={format:"json",region:"world",search:""};var j={};var z=function(P,V,T){if(!V){return;}var T=T||{};if(j[P]){j[P].abort();j[P]=null;}if(t=="locator"){var R="c"+locator._callbackManagement.nextId++;P=k.interpolate(P,{callback:"locator._callbackManagement."+R});locator._callbackManagement[R]=function(W){j[P].destroy();j[P]=null;V(W);};}if(typeof T.useCache!=null&&!T.useCache){var Q=[new Date().getTime(),parseInt(Math.random()*100000)].join(""),U=(P.indexOf("?")>0?"&":"?");P+=U+k.interpolate(M,{random:Q});}var S=L.loadScript(P,{onLoad:function(W){j[P]=null;V(W);},onError:function(){j[P]=null;},useCache:true});if(t=="locator"){}j[P]=S;};var r=function(P){return N[P];};var G=function(Q){for(var P in N){if(N[P]==Q){return P;}}return null;};var I=function(Q,R){for(var S=0,P=Q.length;S
",itemElementEnd:"",searchingClass:"searching",searchingMessage:"",noResultsMessage:"",inputElement:null,show:function(){this.autoSuggest.show();},hide:function(){this.autoSuggest.hide();},displaySearchingMessage:function(){this.autoSuggest.inputElement.addClass(this.searchingClass);if(this.showSearchMessage){this.displayMessage(this.searchingMessage);}},displayNoResultsMessage:function(){this.displayMessage(''+this.noResultsMessage+"");},displayMessage:function(f){this.autoSuggest.setData([{name:f}]);this.autoSuggest.find(f);var e=this;window.setTimeout(function(){e.autoSuggest.show();},10);},formatItem:function(e){return e.name+(e.context?", "+e.context:"");},inputChange:function(){if(this.autoSuggest.val().length0){this.autoSuggest.setData(p);this.autoSuggest.find();}}}};if(!window.locator){window.locator={};}if(!window.locator.ui){window.locator.ui={};}window.locator.ui=d;}});})();(function(){var b,a="postcode";gloader.load(["glow","1","glow.dom","glow.events","glow.widgets.AutoSuggest","glow.i18n"],{onLoad:function(e){b=e;locator.locales.ui="LocatorUI";b.i18n.addLocaleModule(locator.locales.ui,"en",{changeLocationButton:"Change My Location",confirmSave:{confirm:"Confirm",cancel:"Cancel",back:"Back",titleSet:'You have chosen to set My Location to: {location}',bodySet:'
My Location is also shared with the BBC Weather site.
Press Confirm to set your Location, or Cancel to leave it unset.
',titleChange:'You have chosen to change My Location from: {locationOld} to: {location}',bodyChange:'
My Location is also shared with the BBC Weather site.
Press Confirm if you are happy to make this change, or press Cancel to leave My Location as it is.
'},confirmClear:{confirm:"Confirm",cancel:"Cancel",title:"You have chosen to clear My Location.",body:'
Changing your setting here will also clear your location on the BBC Weather site.
Please press Confirm to clear My Location, or press Cancel to leave it set to:
{location}
'},results:{title:"Search Results for '{searchTerm}'"},pagination:{next:"Next",previous:"Prev"},autoSuggest:{searching:"Searching",noResults:"No results found, please try again"}});var c=[];window.locator.ui.Search=function(f,g){this.container=b.dom.get(f);this.searchTerm="";this.searchRegion=g.searchRegion;this.locale=b.i18n.getLocaleModule(locator.locales.ui);};window.locator.ui.Search.prototype={previousContents:[],search:function(g,h){var h=h||{};this.searchTerm=g;this.searchType=h.searchType||null;if(locator.debug){console.log("Search for %o with opts %o",g,h);}this.resetState();var f=this;locator.searchByPlaceName(g,function(j){if(!j){return;}if(j.results.length==0){b.events.fire(f,"noResults");}else{if(j.results.length==1){var i=j.results[0];if(i.has_forecast==0&&(i.type=="County"||i.type=="soundex_County")){if(locator.debug){console.log("COUNTY - only one result, searching again");}f.search(i.site_name,{searchType:"county_state"});}else{var k=k=new locator.Location(i.loc,i.site_name,(i.is_fsssi=="true"?false:true),(i.nation_id?i.nation_id:0));if(i.container){k.container=i.container;}if(locator.debug){console.log("Location object from search: ",k);}f.confirmLocationChange(k,function(l){if(locator.debug){console.log("Success!",l);}locator.setSharedLocationId(l.location.toString(),{_beforeEvent:function(){var m=[];if(i.where_i_live){m.push(i.where_i_live);}if(i.where_i_live_alt){m.push(i.where_i_live_alt);}locator._setDataSet("WID",m.join("~"));}});},function(l){if(locator.debug){console.log("User declined, go back.");}},{disambiguated:false});}}else{f.disambiguate(j);}}},{region:this.searchRegion,type:this.searchType});},showLocationChangeDialogue:function(m,q,i,f){var g=locator.getSharedLocationId()==null?false:true;var h=m.name+(m.container&&m.container!==a?", "+m.container:"");var s=this;var p=g?this.locale.confirmSave.titleChange:this.locale.confirmSave.titleSet;p=b.lang.interpolate(p,{location:h,locationOld:f.locationOld});var l=g?this.locale.confirmSave.bodyChange:this.locale.confirmSave.bodySet;var r=f.disambiguated?this.locale.confirmSave.back:this.locale.confirmSave.cancel;var o=b.lang.apply(this.locale,{title:p,body:l,cancel:r});var k=b.dom.create('